<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><script>(()=>{const e=navigator.serviceWorker;e?e.register("/sw.js").then((async e=>{console.log("SWPP 注册成功");try{await e.periodicSync.register("update",{minInterval:864e5})}catch(e){console.log("Periodic Sync 注册失败",e)}})).catch((e=>console.error("SWPP 注册失败",e))):console.warn("当前浏览器不支持 SW")})()</script><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><title>使用Cf Workers搭建反代加速器 | LiuShen's Blog</title><meta name="author" content="LiuShen"><meta name="copyright" content="LiuShen"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="robots" content="index, follow"><meta name="description" content="转发服务是一种网络工具，它允许用户通过一个中介服务器将请求转发到另一个服务器，从而简化网络请求、绕过限制或增强隐私保护，本篇文章将介绍如何基于Cloudflare搭建反向代理加速器，这个加速器可以用于仓库克隆，模型下载等各类网络环境受限的场景。"><meta property="og:type" content="article"><meta property="og:title" content="使用Cf Workers搭建反代加速器"><meta property="og:url" content="https://blog.liushen.fun/posts/dd89adc9/"><meta property="og:site_name" content="LiuShen's Blog"><meta property="og:description" content="转发服务是一种网络工具，它允许用户通过一个中介服务器将请求转发到另一个服务器，从而简化网络请求、绕过限制或增强隐私保护，本篇文章将介绍如何基于Cloudflare搭建反向代理加速器，这个加速器可以用于仓库克隆，模型下载等各类网络环境受限的场景。"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://p.liiiu.cn/i/2024/05/24/6650245a705d1.png"><meta property="article:published_time" content="2024-05-24T05:31:00.000Z"><meta property="article:modified_time" content="2024-05-24T05:32:00.000Z"><meta property="article:author" content="LiuShen"><meta property="article:tag" content="加速"><meta property="article:tag" content="反向代理"><meta property="article:tag" content="日常分享"><meta property="article:tag" content="Cloudflare"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://p.liiiu.cn/i/2024/05/24/6650245a705d1.png"><link rel="shortcut icon" href="/favicon.ico"><link rel="canonical" href="https://blog.liushen.fun/posts/dd89adc9/"><link rel="preconnect" href="https://jsd.liiiu.cn"><meta name="baidu-site-verification" content="codeva-i2bF9bXDJs"><meta name="sogou_site_verification" content="1rIjtK6RhE"><meta name="360-site-verification" content="b9a9f96ae38a1932a326f8ba255cc74b"><meta name="msvalidate.01" content="F7C246820EB04DD140494C98F93A97C7"><meta name="google-site-verification" content="VH3ZE6m42MZDqpTY2tD-XoxDt9iUj2HoiC3W2neB7F4"><link rel="manifest" href="/manifest.json"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/config/img/pwa/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/config/img/pwa/favicon-16x16.png"><link rel="mask-icon" href="/config/img/pwa/favicon-mask.svg" color="#5bbad5"><link rel="stylesheet" href="/css/index.css?v=5.0.0"><link rel="stylesheet" href="/css/custom.css?v=5.0.0"><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/@fortawesome/fontawesome-free@6.7.2/css/all.min.css"><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/@fancyapps/ui@5.0.36/dist/fancybox/fancybox.min.css" media="print" onload='this.media="all"'><script>(()=>{const e={set:(e,t,o)=>{if(!o)return;const n=Date.now()+864e5*o;localStorage.setItem(e,JSON.stringify({value:t,expiry:n}))},get:e=>{const t=localStorage.getItem(e);if(!t)return;const{value:o,expiry:n}=JSON.parse(t);if(!(Date.now()>n))return o;localStorage.removeItem(e)}};window.btf={saveToLocal:e,getScript:(e,t={})=>new Promise(((o,n)=>{const a=document.createElement("script");a.src=e,a.async=!0,Object.entries(t).forEach((([e,t])=>a.setAttribute(e,t))),a.onload=a.onreadystatechange=()=>{a.readyState&&!/loaded|complete/.test(a.readyState)||o()},a.onerror=n,document.head.appendChild(a)})),getCSS:(e,t)=>new Promise(((o,n)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=e,t&&(a.id=t),a.onload=a.onreadystatechange=()=>{a.readyState&&!/loaded|complete/.test(a.readyState)||o()},a.onerror=n,document.head.appendChild(a)})),addGlobalFn:(e,t,o=!1,n=window)=>{const a=n.globalFn||{};a[e]=a[e]||{},o&&a[e][o]||(a[e][o||Object.keys(a[e]).length]=t,n.globalFn=a)}};const t=()=>{document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},o=()=>{document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};btf.activateDarkMode=t,btf.activateLightMode=o;const n=e.get("theme"),a=(new Date).getHours();void 0===n?a<=6||a>=18?t():o():"light"===n?o():t();const r=e.get("aside-status");void 0!==r&&document.documentElement.classList.toggle("hide-aside","hide"===r);/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})()</script><script>const GLOBAL_CONFIG={root:"/",algolia:{appId:"7IX3UBC6JW",apiKey:"4ac2846352e499675081f1277fb961c1",indexName:"My Blog",hitsPerPage:6,languages:{input_placeholder:"搜索全站文章",hits_empty:"未找到符合您查询的内容：${query}",hits_stats:"找到 ${hits} 条结果，耗时 ${time} 毫秒"}},localSearch:void 0,translate:{defaultEncoding:2,translateDelay:0,msgToTraditionalChinese:"繁",msgToSimplifiedChinese:"簡"},noticeOutdate:{limitDay:365,position:"top",messagePrev:"本篇文章从发布到现在已经隔了",messageNext:"天了，里面的内容可能过期了，你要自己甄别一下哟👉👈"},highlight:{plugin:"highlight.js",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:400,highlightFullpage:!1,highlightMacStyle:!0},copy:{success:"😋复制啦！请注意版权信息呀！",error:"😪呜呜，复制失败了！",noSupport:"🤐浏览器不支持呢，你用的啥玩意？"},relativeDate:{homepage:!1,post:!1},runtime:"天",dateSuffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:{limitCount:1e3,languages:{author:"作者: LiuShen",link:"链接: ",source:"来源: LiuShen's Blog",info:"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},lightbox:"fancybox",Snackbar:{chs_to_cht:"已切换为繁体中文",cht_to_chs:"已切换为简体中文",day_to_night:"已切换为深色模式",night_to_day:"已切换为浅色模式",bgLight:"rgba(255, 255, 255, 0.509)",bgDark:"rgba(48, 48, 48, 0.509)",position:"top-right"},infinitegrid:{js:"https://jsd.liiiu.cn/npm/@egjs/infinitegrid@4.12.0/dist/infinitegrid.min.js",buttonText:"加载更多"},isPhotoFigcaption:!0,islazyload:!0,isAnchor:!1,percent:{toc:!0,rightside:!1},autoDarkmode:!1}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={title:"使用Cf Workers搭建反代加速器",isPost:!0,isHome:!1,isHighlightShrink:void 0,isToc:!0,postUpdate:"2024-05-24 13:32:00"}</script><link rel="stylesheet" href="https://jsd.liiiu.cn/gh/willow-god/Sharding-fonts/Yozai-Medium/result.min.css"><link rel="stylesheet" href="/config/memos/memos.css"><script defer src="/sw-dom.js"></script><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/swiper@11.1.14/swiper-bundle.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="/config/swiper/swiperstyle.css" media="print" onload='this.media="all"'><meta name="generator" content="Hexo 7.3.0"><link rel="alternate" href="/atom.xml" title="LiuShen's Blog" type="application/atom+xml"></head><body><div class="float-box right top"></div><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><img class="load-image" src="" data-lazy-src="/config/img/preloader.gif" alt=""></div><script async>(()=>{const e=document.getElementById("loading-box"),d=document.body,t=()=>{d.style.overflow="",e.classList.add("loaded")},n=()=>{d.style.overflow="hidden",e.classList.remove("loaded")};n();let o=!1;window.addEventListener("load",(()=>{o||(t(),o=!0)})),setTimeout((()=>{o||(t(),o=!0)}),5e3),window.addEventListener("load",(()=>{t()})),setTimeout((function(){t()}),3e3),document.getElementById("loading-box").addEventListener("click",(()=>{t()})),document.addEventListener("pjax:send",(()=>{n()})),document.addEventListener("pjax:complete",(()=>{t()}))})()</script><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="add-menu-container"><div id="travellings"><a class="site-page" href="https://www.travellings.cn/go.html" title="友链接力-随机开往" target="_blank" rel="noopener nofollow"><i class="fa-solid fa-bus fa-fw"></i></a></div><div id="ten-years"><a class="site-page" href="https://foreverblog.cn/go.html" title="友链接力-十年之约" target="_blank" rel="noopener nofollow"><i class="fa-brands fa-nfc-symbol fa-fw"></i></a></div></div><div class="is-center" id="sidebar-avatar"><div class="avatar-img is-center"><img class="mood-icon" src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/14/67d301461a24a.webp" alt="🤤" onerror='this.onerror=null,this.src="/img/friend_404.gif"'><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/13/67d2fc82d329c.webp" onerror='this.onerror=null,this.src="/img/friend_404.gif"' alt="avatar"></div><div class="author-info__name">LiuShen</div></div><div class="site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">72</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">98</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/willow-god"><i class="fab fa-github"></i><span>Follow Me 🛫</span></a><div class="menus_items visible"><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fas fa-home"></i> <span>导航</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.liushen.fun/"><i class="fa-fw fa-solid fa-house-flag"></i> <span>个人主页</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://xc.liushen.fun/"><i class="fa-fw fa fa-camera-retro"></i> <span>个人相册</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-graduation-cap"></i> <span>整理</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i> <span>时光卷轴</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i> <span>文章标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>文章分类</span></a></li><li><a class="site-page child" href="/charts/"><i class="fa-fw fa-solid fa-chart-pie"></i> <span>文章通览</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-user-group"></i> <span>友人</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i> <span>友链展示</span></a></li><li><a class="site-page child" href="/addlink/"><i class="fa-fw fa fa-at"></i> <span>友链申请</span></a></li><li><a class="site-page child" href="/fcircle/"><i class="fa-fw fa-solid fa-circle-nodes"></i> <span>朋友动态</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-paper-plane"></i> <span>留言</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/comment/"><i class="fa-fw fa-solid fa-chalkboard"></i> <span>留言白板</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://mm.liushen.fun/"><i class="fa-fw fa-solid fa-pen-nib"></i> <span>提笔摘星</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-stethoscope"></i> <span>分享</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://gist.liushen.fun/"><i class="fa-fw fa-solid fa-code"></i> <span>代码片段</span></a></li><li><a class="site-page child" href="/subscribe/"><i class="fa-fw fa-solid fa-rss"></i> <span>订阅本站</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://pan.liushen.fun/"><i class="fa-fw fa-solid fa-laptop-file"></i> <span>清羽云盘</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-list"></i> <span>关于</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/about/"><i class="fa-fw fa fa-address-card"></i> <span>站长资料</span></a></li><li><a class="site-page child" href="/shuoshuo/"><i class="fa-fw fa fa-commenting"></i> <span>日常说说</span></a></li><li><a class="site-page child" href="/devices/"><i class="fa-fw fa-solid fa-tachograph-digital"></i> <span>我的设备</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg fixed" id="page-header" style="background-image:url(https://p.liiiu.cn/i/2024/05/24/6650245a705d1.png)"><nav id="nav"><div class="more-app-btn"><i class="fa-solid fa-fingerprint fa-fw"></i><div class="more-app-list-groups"><div class="more-app-list-groups-container"><div class="more-app-list-group"><div class="more-app-list-title">🦄常用网站</div><div class="more-app-list"><a class="more-app-list-item" href="https://www.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-house"></i><span class="more-app-item-text">个人主页</span></a><a class="more-app-list-item" href="https://blog.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-blog"></i><span class="more-app-item-text">个人博客</span></a><a class="more-app-list-item" href="https://xc.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-image"></i><span class="more-app-item-text">个人相册</span></a><a class="more-app-list-item" href="https://github.com/willow-god" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-brands fa-github"></i><span class="more-app-item-text">Github</span></a></div></div><div class="more-app-list-group"><div class="more-app-list-title">😎周边站点</div><div class="more-app-list"><a class="more-app-list-item" href="https://gist.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-code"></i><span class="more-app-item-text">代码片段</span></a><a class="more-app-list-item" href="https://mm.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-pen-nib"></i><span class="more-app-item-text">提笔摘星</span></a><a class="more-app-list-item" href="https://pan.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-cloud"></i><span class="more-app-item-text">清羽云盘</span></a><a class="more-app-list-item" href="https://um.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-people-group"></i><span class="more-app-item-text">访客统计</span></a><a class="more-app-list-item" href="https://img.liiiu.cn/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-images"></i><span class="more-app-item-text">清羽图床</span></a><a class="more-app-list-item" href="https://chat.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-robot"></i><span class="more-app-item-text">清羽AI</span></a><a class="more-app-list-item" href="https://bsz.liiiu.cn/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-chart-pie"></i><span class="more-app-item-text">不蒜计数</span></a><a class="more-app-list-item" href="https://status.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-server"></i><span class="more-app-item-text">服务检测</span></a></div></div><div class="more-app-list-group"><div class="more-app-list-title">🚁实用工具</div><div class="more-app-list"><a class="more-app-list-item" href="https://tmail.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-envelope"></i><span class="more-app-item-text">临时邮箱</span></a><a class="more-app-list-item" href="https://hot.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-fire"></i><span class="more-app-item-text">每日热榜</span></a><a class="more-app-list-item" href="https://cover.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-eye"></i><span class="more-app-item-text">封面设计</span></a><a class="more-app-list-item" href="https://mini-cover.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-image"></i><span class="more-app-item-text">迷你封面</span></a><a class="more-app-list-item" href="https://icon.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-icons"></i><span class="more-app-item-text">万能图标</span></a><a class="more-app-list-item" href="https://draw.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-paintbrush"></i><span class="more-app-item-text">灵感白板</span></a><a class="more-app-list-item" href="https://mindmap.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-network-wired"></i><span class="more-app-item-text">思维导图</span></a><a class="more-app-list-item" href="https://share.liushen.fun/#/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-share-nodes"></i><span class="more-app-item-text">内容中转</span></a></div></div></div></div></div><span id="blog-info"><a class="nav-site-title" href="/" title="LiuShen's Blog"><span class="site-name">LiuShen</span></a></span><div id="menus"></div><div class="menus_items visible"><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fas fa-home"></i> <span>导航</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.liushen.fun/"><i class="fa-fw fa-solid fa-house-flag"></i> <span>个人主页</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://xc.liushen.fun/"><i class="fa-fw fa fa-camera-retro"></i> <span>个人相册</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-graduation-cap"></i> <span>整理</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i> <span>时光卷轴</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i> <span>文章标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>文章分类</span></a></li><li><a class="site-page child" href="/charts/"><i class="fa-fw fa-solid fa-chart-pie"></i> <span>文章通览</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-user-group"></i> <span>友人</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i> <span>友链展示</span></a></li><li><a class="site-page child" href="/addlink/"><i class="fa-fw fa fa-at"></i> <span>友链申请</span></a></li><li><a class="site-page child" href="/fcircle/"><i class="fa-fw fa-solid fa-circle-nodes"></i> <span>朋友动态</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-paper-plane"></i> <span>留言</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/comment/"><i class="fa-fw fa-solid fa-chalkboard"></i> <span>留言白板</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://mm.liushen.fun/"><i class="fa-fw fa-solid fa-pen-nib"></i> <span>提笔摘星</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-stethoscope"></i> <span>分享</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://gist.liushen.fun/"><i class="fa-fw fa-solid fa-code"></i> <span>代码片段</span></a></li><li><a class="site-page child" href="/subscribe/"><i class="fa-fw fa-solid fa-rss"></i> <span>订阅本站</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://pan.liushen.fun/"><i class="fa-fw fa-solid fa-laptop-file"></i> <span>清羽云盘</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-list"></i> <span>关于</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/about/"><i class="fa-fw fa fa-address-card"></i> <span>站长资料</span></a></li><li><a class="site-page child" href="/shuoshuo/"><i class="fa-fw fa fa-commenting"></i> <span>日常说说</span></a></li><li><a class="site-page child" href="/devices/"><i class="fa-fw fa-solid fa-tachograph-digital"></i> <span>我的设备</span></a></li></ul></div></div><center id="name-container"><a id="page-name" href="javascript:btf.scrollToDest(0, 500)">PAGE_NAME</a></center><div id="nav-right"><div id="travellings"><a class="site-page" href="https://www.travellings.cn/go.html" title="友链接力-随机开往" target="_blank" rel="noopener nofollow"><i class="fa-solid fa-bus fa-fw"></i></a></div><div id="ten-years"><a class="site-page" href="https://foreverblog.cn/go.html" title="友链接力-十年之约" target="_blank" rel="noopener nofollow"><i class="fa-brands fa-nfc-symbol fa-fw"></i></a></div><div id="random"><a class="site-page" href="javascript:randomPost()" title="随机前往一个文章"><i class="fa-solid fa-shuffle fa-fw"></i></a></div><div id="search-button"><span class="site-page social-icon search"><i class="fas fa-search fa-fw"></i></span></div><div id="toggle-menu"><span class="site-page" href="javascript:void(0);" title="展开菜单"><i class="fas fa-indent fa-fw"></i></span></div></div></nav><div id="post-info"><h1 class="post-title">使用Cf Workers搭建反代加速器</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-05-24T05:31:00.000Z" title="发表于 2024-05-24 13:31:00">2024-05-24</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-05-24T05:32:00.000Z" title="更新于 2024-05-24 13:32:00">2024-05-24</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/daily-share/">日常分享</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">总字数:</span><span class="word-count">4.7k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>18分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" data-flag-title=""><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">浏览量:</span><span id="busuanzi_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/posts/dd89adc9/#post-comment"><span id="ArtalkCount"><i class="fa-solid fa-spinner fa-spin"></i></span></a></span></div></div></div><section class="main-hero-waves-area waves-area"><svg class="waves-svg" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s58 18 88 18 58-18 88-18 58 18 88 18v44h-352Z"></path></defs><g class="parallax"><use href="#gentle-wave" x="48" y="0"></use><use href="#gentle-wave" x="48" y="3"></use><use href="#gentle-wave" x="48" y="5"></use><use href="#gentle-wave" x="48" y="7"></use></g></svg></section></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><div class="ai-summary"><div class="ai-head"><div class="ai-head-left"><div class="ai-circle ai-circle-1"></div><div class="ai-circle ai-circle-2"></div><div class="ai-circle ai-circle-3"></div></div><div class="ai-head-right"><a class="ai-about-ai" href="/posts/40702a0d/">关于AI</a></div></div><div class="ai-explanation" style="display:block" data-summary="这里是清羽AI，这篇文章介绍了如何使用Cloudflare Workers搭建反代加速器。文章首先解释了转发工具的原理，即作为中介接收客户端请求并转发到目标服务器，再返回响应给客户端。接着，文章详细步骤指导读者创建CF-Worker，包括所需工具和具体操作。文章还提供了通用转发接口的代码示例，以及如何使用该接口进行加速。此外，文章还介绍了如何将服务迁移到自定义域名上，并展示了专用转发功能的使用方法，例如搭建GitHub镜像站。最后，文章强调了使用服务时需要注意的事项，如遵守使用条款、保护个人隐私和数据安全、尊重版权和知识产权等。整体上，这篇文章为读者提供了使用Cloudflare Workers搭建反代加速器的全面指南。">清羽AI正在绞尽脑汁想思路ING···</div><div class="ai-title"><div class="ai-title-left"><i class="fa-brands fa-slack"></i><div class="ai-title-text">清羽のAI摘要</div></div><div class="ai-tag" id="ai-tag">GLM-4-Flash</div></div></div><h2 id="碎碎念"><a href="#碎碎念" class="headerlink" title="碎碎念"></a>碎碎念</h2><p>近期经常因为学习一些内容，经常克隆一些仓库，但是服务器上克隆<code>github</code>的速度确实有点不理想，恰好朋友<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly93d3cuem91aHQuY29tLw">颢天</a>出了一篇文章，感觉很实用，于是我尝试部署了一下，速度确实有所提升，于是在此分享给大家！</p><h2 id="原理"><a href="#原理" class="headerlink" title="原理"></a>原理</h2><p>转发工具的原理基于网络请求的代理机制。它作为一个中介，接收客户端的请求，然后将其转发到目标服务器，并最终将目标服务器的响应返回给客户端。想象一下，你在网上想访问一个网站，但是直接访问有点麻烦，可能是因为网站有安全设置，或者是因为网络限制。这时候，转发工具就像是一个友好的中间人，它帮你去敲那扇门。</p><ol><li><strong>你提出请求</strong>：你对中间人说，“嘿，帮我去那个网站看看。” 这就是你向转发工具发送的请求。</li><li><strong>中间人帮忙</strong>：中间人听到你的请求后，就跑到那个网站去敲门，帮你问问题或者拿东西。</li><li><strong>处理一下</strong>：在去敲门之前，中间人可能会检查一下你给的信息，看看有没有什么需要改的，比如换个说法或者加个帽子（修改请求头）。</li><li><strong>敲门</strong>：中间人拿着你的信息去到那个网站，然后按照你的要求去请求信息。</li><li><strong>拿回应答</strong>：网站回应了中间人，给了他一些信息或者数据。</li><li><strong>可能再处理一下</strong>：中间人拿到回应后，可能会再检查一遍，看看有没有什么需要调整的，比如换个包装（修改响应头）。</li><li><strong>给你回应</strong>：最后，中间人把网站给的回应带给你，你就得到了你想要的信息。</li><li><strong>记个小本本</strong>：有时候，中间人还会把这次帮忙的过程记下来，以后可以看看都帮了什么忙，或者出了问题可以查一查。</li></ol><p>转发工具就像是这个中间人，它帮助用户更方便地访问网站，同时也可能帮助用户绕过一些访问限制，或者保护用户的隐私。整个过程就像是通过一个友好的邻居去帮你跑腿一样简单。</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/24/665026b03e5e6.png" alt="反向代理转发"></p><h2 id="教程"><a href="#教程" class="headerlink" title="教程"></a>教程</h2><h3 id="所需工具"><a href="#所需工具" class="headerlink" title="所需工具"></a>所需工具</h3><ol><li><code>cloudflare</code>账号</li><li><code>Name Service</code>为<code>cloudflare</code>的一个域名</li></ol><h3 id="创建CF-Worker"><a href="#创建CF-Worker" class="headerlink" title="创建CF-Worker"></a>创建CF-Worker</h3><p>打开<code>Cloudflare</code>侧边栏中的<code>Workers and Pages</code> -&gt; <code>概述</code>，进入<code>worker</code>控制面板</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/24/665027f6d7f9c.png" alt="概述"></p><p>选择创建应用程序，创建你的第一个反向代理加速器，下一个页面继续点创建，这里不再放图片。</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/24/665028a37a45e.png" alt="创建"></p><p>到部署<code>hello World</code>脚本部分，你可以修改名称后，点击右下角部署进行下一步</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/24/665029f846716.png" alt="创建"></p><p>到下一步后，我们的<code>worker</code>就创建好了，下面点击修改代码</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/24/66502b1937be5.png" alt="点击编辑代码旋蒸"></p><h3 id="通用转发"><a href="#通用转发" class="headerlink" title="通用转发"></a>通用转发</h3><p>下面是通用转发接口，适用于所有加速服务，编辑左侧代码使其转发网站内容，源代码来自于<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly93d3cuem91aHQuY29tLw">颢天</a>，我将其稍加修改，将主页设置为介绍文档，代码如下：</p><figure class="highlight javascript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br></pre></td><td class="code"><pre><span class="line"><span class="title function_">addEventListener</span>(<span class="string">'fetch'</span>, <span class="function"><span class="params">event</span> =&gt;</span> {</span><br><span class="line">  event.<span class="title function_">respondWith</span>(<span class="title function_">handleRequest</span>(event.<span class="property">request</span>))</span><br><span class="line">})</span><br><span class="line"><span class="keyword">const</span> specialCases = {</span><br><span class="line">  <span class="string">"*"</span>: {</span><br><span class="line">    <span class="string">"Origin"</span>: <span class="string">"DELETE"</span>,</span><br><span class="line">    <span class="string">"Referer"</span>: <span class="string">"DELETE"</span></span><br><span class="line">  }</span><br><span class="line">}</span><br><span class="line"><span class="keyword">function</span> <span class="title function_">handleSpecialCases</span>(<span class="params">request</span>) {</span><br><span class="line">  <span class="keyword">const</span> url = <span class="keyword">new</span> <span class="title function_">URL</span>(request.<span class="property">url</span>);</span><br><span class="line">  <span class="keyword">const</span> rules = specialCases[url.<span class="property">hostname</span>] || specialCases[<span class="string">"*"</span>];</span><br><span class="line">  <span class="keyword">for</span> (<span class="keyword">const</span> [key, value] <span class="keyword">of</span> <span class="title class_">Object</span>.<span class="title function_">entries</span>(rules)) {</span><br><span class="line">    <span class="keyword">switch</span> (value) {</span><br><span class="line">      <span class="keyword">case</span> <span class="string">"KEEP"</span>:</span><br><span class="line">        <span class="keyword">break</span>;</span><br><span class="line">      <span class="keyword">case</span> <span class="string">"DELETE"</span>:</span><br><span class="line">        request.<span class="property">headers</span>.<span class="title function_">delete</span>(key);</span><br><span class="line">        <span class="keyword">break</span>;</span><br><span class="line">      <span class="attr">default</span>:</span><br><span class="line">        request.<span class="property">headers</span>.<span class="title function_">set</span>(key, value);</span><br><span class="line">        <span class="keyword">break</span>;</span><br><span class="line">    }</span><br><span class="line">  }</span><br><span class="line">}</span><br><span class="line"><span class="keyword">async</span> <span class="keyword">function</span> <span class="title function_">handleRequest</span>(<span class="params">request</span>) {</span><br><span class="line">  <span class="keyword">const</span> url = <span class="keyword">new</span> <span class="title function_">URL</span>(request.<span class="property">url</span>);</span><br><span class="line">  <span class="keyword">if</span> (url.<span class="property">pathname</span> === <span class="string">"/"</span>) {</span><br><span class="line">    <span class="keyword">return</span> <span class="keyword">new</span> <span class="title class_">Response</span>(<span class="string">`&lt;!DOCTYPE html&gt;</span></span><br><span class="line"><span class="string">&lt;html lang="zh-CN"&gt;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">&lt;head&gt;</span></span><br><span class="line"><span class="string">  &lt;meta charset="UTF-8"&gt;</span></span><br><span class="line"><span class="string">  &lt;title&gt;转发服务使用指南&lt;/title&gt;</span></span><br><span class="line"><span class="string">  &lt;style&gt;</span></span><br><span class="line"><span class="string">    body {</span></span><br><span class="line"><span class="string">      font-family: Arial, sans-serif;</span></span><br><span class="line"><span class="string">      margin: 0;</span></span><br><span class="line"><span class="string">      padding: 0;</span></span><br><span class="line"><span class="string">      background: #f4f4f4;</span></span><br><span class="line"><span class="string">    }</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    .container {</span></span><br><span class="line"><span class="string">      width: 80%;</span></span><br><span class="line"><span class="string">      margin: auto;</span></span><br><span class="line"><span class="string">      overflow: hidden;</span></span><br><span class="line"><span class="string">    }</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    header {</span></span><br><span class="line"><span class="string">      background: #333;</span></span><br><span class="line"><span class="string">      color: #fff;</span></span><br><span class="line"><span class="string">      padding: 20px;</span></span><br><span class="line"><span class="string">      text-align: center;</span></span><br><span class="line"><span class="string">    }</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    section {</span></span><br><span class="line"><span class="string">      padding: 20px;</span></span><br><span class="line"><span class="string">      margin-bottom: 20px;</span></span><br><span class="line"><span class="string">    }</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    .example {</span></span><br><span class="line"><span class="string">      background: #fff;</span></span><br><span class="line"><span class="string">      padding: 20px;</span></span><br><span class="line"><span class="string">      border-radius: 4px;</span></span><br><span class="line"><span class="string">    }</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    h2 {</span></span><br><span class="line"><span class="string">      color: #333;</span></span><br><span class="line"><span class="string">    }</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    code {</span></span><br><span class="line"><span class="string">      background: #ddd;</span></span><br><span class="line"><span class="string">      padding: 2px 6px;</span></span><br><span class="line"><span class="string">      border-radius: 4px;</span></span><br><span class="line"><span class="string">      display: inline-block;</span></span><br><span class="line"><span class="string">      margin: 0 5px;</span></span><br><span class="line"><span class="string">    }</span></span><br><span class="line"><span class="string">  &lt;/style&gt;</span></span><br><span class="line"><span class="string">&lt;/head&gt;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">&lt;body&gt;</span></span><br><span class="line"><span class="string">  &lt;header&gt;</span></span><br><span class="line"><span class="string">    &lt;h1&gt;转发服务使用指南&lt;/h1&gt;</span></span><br><span class="line"><span class="string">  &lt;/header&gt;</span></span><br><span class="line"><span class="string">  &lt;div class="container"&gt;</span></span><br><span class="line"><span class="string">    &lt;section&gt;</span></span><br><span class="line"><span class="string">      &lt;h2&gt;简介&lt;/h2&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;本服务是一个轻量级的https请求转发代理，可以帮助您绕过某些网络限制，或者在开发过程中模拟https请求。该转发接口基于Cloudflare构建，以提供快速且安全的服务体验。&lt;/p&gt;</span></span><br><span class="line"><span class="string">    &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;section&gt;</span></span><br><span class="line"><span class="string">      &lt;h2&gt;服务域名&lt;/h2&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;我们提供了多个转发服务域名，您可以根据需要选择合适的服务域名：&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;ul&gt;</span></span><br><span class="line"><span class="string">        &lt;li&gt;&lt;strong&gt;通用转发服务：&lt;/strong&gt;&lt;code&gt;https://lius.me&lt;/code&gt;&lt;/li&gt;</span></span><br><span class="line"><span class="string">        &lt;li&gt;&lt;strong&gt;Gravatar 转发服务：&lt;/strong&gt;&lt;code&gt;https://gravatar.lius.me&lt;/code&gt;&lt;/li&gt;</span></span><br><span class="line"><span class="string">        &lt;li&gt;&lt;strong&gt;GitHub 转发服务：&lt;/strong&gt;&lt;code&gt;https://github.lius.me&lt;/code&gt;&lt;/li&gt;</span></span><br><span class="line"><span class="string">      &lt;/ul&gt;</span></span><br><span class="line"><span class="string">    &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;section&gt;</span></span><br><span class="line"><span class="string">      &lt;h2&gt;如何使用&lt;/h2&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;使用转发服务非常简单，只需遵循以下步骤：&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;ol&gt;</span></span><br><span class="line"><span class="string">        &lt;li&gt;确定您想要访问的目标URL。&lt;/li&gt;</span></span><br><span class="line"><span class="string">        &lt;li&gt;根据您的需求选择相应的转发服务域名。&lt;/li&gt;</span></span><br><span class="line"><span class="string">        &lt;li&gt;在浏览器地址栏输入我们的转发服务URL，并在其后附加目标URL的完整路径。&lt;/li&gt;</span></span><br><span class="line"><span class="string">        &lt;li&gt;按下回车键，我们的服务将自动将请求转发到目标URL。&lt;/li&gt;</span></span><br><span class="line"><span class="string">      &lt;/ol&gt;</span></span><br><span class="line"><span class="string">    &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;section&gt;</span></span><br><span class="line"><span class="string">      &lt;h2&gt;特定域名转发接口&lt;/h2&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;我们为一些常用的服务提供了专门的转发接口，以优化访问速度和体验。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;section class="example"&gt;</span></span><br><span class="line"><span class="string">        &lt;h3&gt;Gravatar 转发&lt;/h3&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;如果您需要访问Gravatar的头像服务，可以使用以下转发接口：&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;strong&gt;转发服务域名：&lt;/strong&gt;&lt;code&gt;https://gravatar.lius.me&lt;/code&gt;&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;strong&gt;示例：&lt;/strong&gt;要获取用户&lt;code&gt;someuser&lt;/code&gt;的Gravatar头像，访问以下URL：&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;code&gt;https://gravatar.lius.me/avatar/someuser?s=128&lt;/code&gt;&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;/section&gt;</span></span><br><span class="line"><span class="string">      &lt;section class="example"&gt;</span></span><br><span class="line"><span class="string">        &lt;h3&gt;GitHub 转发&lt;/h3&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;如果您需要访问GitHub的API或资源，可以使用以下转发接口：&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;strong&gt;转发服务域名：&lt;/strong&gt;&lt;code&gt;https://github.lius.me&lt;/code&gt;&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;strong&gt;示例：&lt;/strong&gt;要访问用户&lt;code&gt;someuser&lt;/code&gt;的GitHub仓库&lt;code&gt;repo&lt;/code&gt;，请访问：&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;code&gt;https://github.lius.me/users/someuser/repos/repo&lt;/code&gt;&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;section&gt;</span></span><br><span class="line"><span class="string">      &lt;h2&gt;通用转发服务&lt;/h2&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;对于不提供专门转发接口的网站，您可以继续使用我们的通用转发服务。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;section class="example"&gt;</span></span><br><span class="line"><span class="string">        &lt;h3&gt;通用转发示例&lt;/h3&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;strong&gt;转发服务域名：&lt;/strong&gt;&lt;code&gt;https://lius.me&lt;/code&gt;&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;strong&gt;示例：&lt;/strong&gt;要访问&lt;code&gt;https://example.com/api/data&lt;/code&gt;，请使用以下URL：&lt;/p&gt;</span></span><br><span class="line"><span class="string">        &lt;p&gt;&lt;code&gt;https://lius.me/https://example.com/api/data&lt;/code&gt;&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;section&gt;</span></span><br><span class="line"><span class="string">      &lt;h2&gt;注意事项&lt;/h2&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;在使用转发服务时，请仔细阅读并遵守以下条款：&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;h3&gt;遵守使用条款&lt;/h3&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;您必须遵守目标网站的使用条款和条件。本服务仅作为请求转发的中介，并不对目标网站的内容或服务负责。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;h3&gt;隐私和数据安全&lt;/h3&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;保护您的个人隐私和数据安全至关重要。请不要通过本服务发送任何敏感或个人身份信息，除非您已经确认目标网站具有足够的安全措施。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;h3&gt;版权和知识产权&lt;/h3&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;您应确保在使用本服务转发内容时，不侵犯任何第三方的版权或知识产权。对于因违反版权或知识产权法律而导致的任何争议或法律责任，您应自行承担。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;h3&gt;服务限制&lt;/h3&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;本服务有可能会限制请求的数量、频率或大小。请合理使用服务，避免对服务或目标网站造成不必要的负担。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;h3&gt;免责声明&lt;/h3&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;本服务提供“按原样”的转发服务，不提供任何形式的保证。我们不对通过本服务转发的内容的准确性、可靠性或质量负责，也不对因使用本服务而可能遭受的任何损失或损害承担责任。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;h3&gt;服务变更和中断&lt;/h3&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;我们保留随时修改、更新或中断服务的权利，无需事先通知。我们不承担因服务变更或中断而造成的任何责任。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;h3&gt;用户行为&lt;/h3&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;您应确保在使用服务时遵守所有适用的法律和规定，不进行任何非法活动或恶意行为，包括但不限于网络攻击、数据爬取或任何形式的网络欺诈。&lt;/p&gt;</span></span><br><span class="line"><span class="string">    &lt;/section&gt;</span></span><br><span class="line"><span class="string">    &lt;section&gt;</span></span><br><span class="line"><span class="string">      &lt;h2&gt;免责声明&lt;/h2&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;&lt;strong&gt;免责声明：&lt;/strong&gt;&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;· 使用本转发服务时，您应自行承担风险。我们不保证服务的及时性、安全性、可用性或准确性。对于因使用或无法使用本服务而造成的任何直接、间接、特殊或后果性损害，我们不承担任何责任。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;· 我们不对通过本服务转发的内容承担责任，包括但不限于版权、商标或其他知识产权问题。您应确保您有权转发目标URL的内容，并且遵守所有适用的法律和规定。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;· 我们保留随时修改或中断服务的权利，无需事先通知。本服务不提供任何形式的保证或条件，无论是明示的还是暗示的。&lt;/p&gt;</span></span><br><span class="line"><span class="string">      &lt;p&gt;· 该服务不收取任何费用，使用开源代码创建，如果本服务侵犯了任何您的权利以及现有条款，我们将立刻关闭该服务。&lt;/p&gt;</span></span><br><span class="line"><span class="string">    &lt;/section&gt;</span></span><br><span class="line"><span class="string">  &lt;/div&gt;</span></span><br><span class="line"><span class="string">&lt;/body&gt;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">&lt;/html&gt;`</span>,{</span><br><span class="line">  <span class="attr">headers</span>: {</span><br><span class="line">    <span class="string">'content-type'</span>: <span class="string">'text/html;charset=UTF-8'</span>,</span><br><span class="line">  },</span><br><span class="line">  <span class="attr">status</span>: <span class="number">200</span> <span class="comment">// 确保状态码是200</span></span><br><span class="line">});</span><br><span class="line">  };</span><br><span class="line">  <span class="keyword">const</span> actualUrlStr = url.<span class="property">pathname</span>.<span class="title function_">replace</span>(<span class="string">"/"</span>, <span class="string">""</span>) + url.<span class="property">search</span> + url.<span class="property">hash</span>;</span><br><span class="line">  <span class="keyword">const</span> actualUrl = <span class="keyword">new</span> <span class="title function_">URL</span>(actualUrlStr);</span><br><span class="line">  <span class="keyword">const</span> modifiedRequest = <span class="keyword">new</span> <span class="title class_">Request</span>(actualUrl, {</span><br><span class="line">    <span class="attr">headers</span>: request.<span class="property">headers</span>,</span><br><span class="line">    <span class="attr">method</span>: request.<span class="property">method</span>,</span><br><span class="line">    <span class="attr">body</span>: request.<span class="property">body</span>,</span><br><span class="line">    <span class="attr">redirect</span>: <span class="string">'follow'</span></span><br><span class="line">  });</span><br><span class="line">  <span class="title function_">handleSpecialCases</span>(modifiedRequest);</span><br><span class="line">  <span class="keyword">const</span> response = <span class="keyword">await</span> <span class="title function_">fetch</span>(modifiedRequest);</span><br><span class="line">  <span class="keyword">const</span> modifiedResponse = <span class="keyword">new</span> <span class="title class_">Response</span>(response.<span class="property">body</span>, response);</span><br><span class="line">  modifiedResponse.<span class="property">headers</span>.<span class="title function_">set</span>(<span class="string">'Access-Control-Allow-Origin'</span>, <span class="string">'*'</span>);</span><br><span class="line">  <span class="keyword">return</span> modifiedResponse;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p>部署完成后，访问对应的域名，你会得到以下页面：</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/24/66502c865f07b.png" alt="转发主页说明"></p><p>当然，由于一些普遍知晓的情况，访问<code>workers.dev</code>域名可能会遇到一些障碍。为了解决这个问题，我们可以轻松地将服务迁移到自己的域名上。以下是操作步骤：</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/24/66502dd25991b.png" alt="修改域名"></p><ol><li><p>登录到我们的<code>Cloudflare</code>账户，找到并点击“设置”选项。</p></li><li><p>在设置菜单中，寻找并选择“触发器”功能。</p></li><li><p>在触发器页面，点击“添加自定义域”按钮。</p></li><li><p>在弹出的对话框中，输入我们希望使用的域名。</p></li></ol><p>请注意，为了使自定义域名在<code>Cloudflare</code>上生效，需要确保该域名的名称服务器已经指向<code>CloudFlare</code>。这样，就可以享受到<code>Cloudflare</code>提供的加速和安全服务，同时使用自己的域名来访问<code>Workers</code>服务了。</p><p>通过这些简单的步骤，你就可以拥有一个个性化且易于访问的服务入口啦。</p><h4 id="使用教程"><a href="#使用教程" class="headerlink" title="使用教程"></a>使用教程</h4><p>（使用教程内容来自颢天）这个代码的使用方式非常简单，将自己要加速的链接跟在<code>/</code>后面就行了。例如：</p><ul><li>原始链接：<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vZXhhbXBsZS56aXA">https://www.example.com/example.zip</a></li><li>加速链接：https://&lt;你绑定的 Worker 域名&gt;/<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vZXhhbXBsZS56aXA">https://www.example.com/example.zip</a></li></ul><p>具体内容大家可以到文章尾部的原文链接中进行查看。</p><h3 id="专用转发"><a href="#专用转发" class="headerlink" title="专用转发"></a>专用转发</h3><p>除了提供基础的通用转发功能，我们的服务还能够通过转发机制，实现镜像站点的创建。例如，我们可以利用这一功能搭建一个类似于 <code>GitHub</code> 或 <code>Gravatar</code> 的镜像站。接下来，我将以 <code>GitHub</code> 为例，展示如何实现这一过程。</p><p>在实现这一功能时，你需要在编辑代码代码部分进行相应的设置。修改代码如下：</p><figure class="highlight javascript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 你要镜像的网站.</span></span><br><span class="line"><span class="keyword">const</span> upstream = <span class="string">'www.github.com'</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 镜像网站的目录，比如你想镜像某个网站的二级目录则填写二级目录的目录名，镜像 google 用不到，默认即可.</span></span><br><span class="line"><span class="keyword">const</span> upstream_path = <span class="string">'/'</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 镜像站是否有手机访问专用网址，没有则填一样的.</span></span><br><span class="line"><span class="keyword">const</span> upstream_mobile = <span class="string">'www.github.com'</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 屏蔽国家和地区.</span></span><br><span class="line"><span class="keyword">const</span> blocked_region = [<span class="string">'KP'</span>, <span class="string">'SY'</span>, <span class="string">'PK'</span>, <span class="string">'CU'</span>]</span><br><span class="line"></span><br><span class="line"><span class="comment">// 屏蔽 IP 地址.</span></span><br><span class="line"><span class="keyword">const</span> blocked_ip_address = [<span class="string">'0.0.0.0'</span>, <span class="string">'127.0.0.1'</span>]</span><br><span class="line"></span><br><span class="line"><span class="comment">// 镜像站是否开启 HTTPS.</span></span><br><span class="line"><span class="keyword">const</span> https = <span class="literal">true</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 文本替换.</span></span><br><span class="line"><span class="keyword">const</span> replace_dict = {</span><br><span class="line">    <span class="string">'$upstream'</span>: <span class="string">'$custom_domain'</span>,</span><br><span class="line">    <span class="string">'//github.com'</span>: <span class="string">''</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">// 以下保持默认，不要动</span></span><br><span class="line"><span class="title function_">addEventListener</span>(<span class="string">'fetch'</span>, <span class="function"><span class="params">event</span> =&gt;</span> {</span><br><span class="line">    event.<span class="title function_">respondWith</span>(<span class="title function_">fetchAndApply</span>(event.<span class="property">request</span>));</span><br><span class="line">})</span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> <span class="keyword">function</span> <span class="title function_">fetchAndApply</span>(<span class="params">request</span>) {</span><br><span class="line"></span><br><span class="line">    <span class="keyword">const</span> region = request.<span class="property">headers</span>.<span class="title function_">get</span>(<span class="string">'cf-ipcountry'</span>).<span class="title function_">toUpperCase</span>();</span><br><span class="line">    <span class="keyword">const</span> ip_address = request.<span class="property">headers</span>.<span class="title function_">get</span>(<span class="string">'cf-connecting-ip'</span>);</span><br><span class="line">    <span class="keyword">const</span> user_agent = request.<span class="property">headers</span>.<span class="title function_">get</span>(<span class="string">'user-agent'</span>);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">let</span> response = <span class="literal">null</span>;</span><br><span class="line">    <span class="keyword">let</span> url = <span class="keyword">new</span> <span class="title function_">URL</span>(request.<span class="property">url</span>);</span><br><span class="line">    <span class="keyword">let</span> url_hostname = url.<span class="property">hostname</span>;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (https == <span class="literal">true</span>) {</span><br><span class="line">        url.<span class="property">protocol</span> = <span class="string">'https:'</span>;</span><br><span class="line">    } <span class="keyword">else</span> {</span><br><span class="line">        url.<span class="property">protocol</span> = <span class="string">'http:'</span>;</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (<span class="keyword">await</span> <span class="title function_">device_status</span>(user_agent)) {</span><br><span class="line">        <span class="keyword">var</span> upstream_domain = upstream;</span><br><span class="line">    } <span class="keyword">else</span> {</span><br><span class="line">        <span class="keyword">var</span> upstream_domain = upstream_mobile;</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    url.<span class="property">host</span> = upstream_domain;</span><br><span class="line">    <span class="keyword">if</span> (url.<span class="property">pathname</span> == <span class="string">'/'</span>) {</span><br><span class="line">        url.<span class="property">pathname</span> = upstream_path;</span><br><span class="line">    } <span class="keyword">else</span> {</span><br><span class="line">        url.<span class="property">pathname</span> = upstream_path + url.<span class="property">pathname</span>;</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (blocked_region.<span class="title function_">includes</span>(region)) {</span><br><span class="line">        response = <span class="keyword">new</span> <span class="title class_">Response</span>(<span class="string">'Access denied: WorkersProxy is not available in your region yet.'</span>, {</span><br><span class="line">            <span class="attr">status</span>: <span class="number">403</span></span><br><span class="line">        });</span><br><span class="line">    } <span class="keyword">else</span> <span class="keyword">if</span> (blocked_ip_address.<span class="title function_">includes</span>(ip_address)) {</span><br><span class="line">        response = <span class="keyword">new</span> <span class="title class_">Response</span>(<span class="string">'Access denied: Your IP address is blocked by WorkersProxy.'</span>, {</span><br><span class="line">            <span class="attr">status</span>: <span class="number">403</span></span><br><span class="line">        });</span><br><span class="line">    } <span class="keyword">else</span> {</span><br><span class="line">        <span class="keyword">let</span> method = request.<span class="property">method</span>;</span><br><span class="line">        <span class="keyword">let</span> request_headers = request.<span class="property">headers</span>;</span><br><span class="line">        <span class="keyword">let</span> new_request_headers = <span class="keyword">new</span> <span class="title class_">Headers</span>(request_headers);</span><br><span class="line"></span><br><span class="line">        new_request_headers.<span class="title function_">set</span>(<span class="string">'Host'</span>, url.<span class="property">hostname</span>);</span><br><span class="line">        new_request_headers.<span class="title function_">set</span>(<span class="string">'Referer'</span>, url.<span class="property">hostname</span>);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">let</span> original_response = <span class="keyword">await</span> <span class="title function_">fetch</span>(url.<span class="property">href</span>, {</span><br><span class="line">            <span class="attr">method</span>: method,</span><br><span class="line">            <span class="attr">headers</span>: new_request_headers</span><br><span class="line">        })</span><br><span class="line"></span><br><span class="line">        <span class="keyword">let</span> original_response_clone = original_response.<span class="title function_">clone</span>();</span><br><span class="line">        <span class="keyword">let</span> original_text = <span class="literal">null</span>;</span><br><span class="line">        <span class="keyword">let</span> response_headers = original_response.<span class="property">headers</span>;</span><br><span class="line">        <span class="keyword">let</span> new_response_headers = <span class="keyword">new</span> <span class="title class_">Headers</span>(response_headers);</span><br><span class="line">        <span class="keyword">let</span> status = original_response.<span class="property">status</span>;</span><br><span class="line"></span><br><span class="line">        new_response_headers.<span class="title function_">set</span>(<span class="string">'access-control-allow-origin'</span>, <span class="string">'*'</span>);</span><br><span class="line">        new_response_headers.<span class="title function_">set</span>(<span class="string">'access-control-allow-credentials'</span>, <span class="literal">true</span>);</span><br><span class="line">        new_response_headers.<span class="title function_">delete</span>(<span class="string">'content-security-policy'</span>);</span><br><span class="line">        new_response_headers.<span class="title function_">delete</span>(<span class="string">'content-security-policy-report-only'</span>);</span><br><span class="line">        new_response_headers.<span class="title function_">delete</span>(<span class="string">'clear-site-data'</span>);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> content_type = new_response_headers.<span class="title function_">get</span>(<span class="string">'content-type'</span>);</span><br><span class="line">        <span class="keyword">if</span> (content_type.<span class="title function_">includes</span>(<span class="string">'text/html'</span>) &amp;&amp; content_type.<span class="title function_">includes</span>(<span class="string">'UTF-8'</span>)) {</span><br><span class="line">            original_text = <span class="keyword">await</span> <span class="title function_">replace_response_text</span>(original_response_clone, upstream_domain, url_hostname);</span><br><span class="line">        } <span class="keyword">else</span> {</span><br><span class="line">            original_text = original_response_clone.<span class="property">body</span></span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        response = <span class="keyword">new</span> <span class="title class_">Response</span>(original_text, {</span><br><span class="line">            status,</span><br><span class="line">            <span class="attr">headers</span>: new_response_headers</span><br><span class="line">        })</span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">return</span> response;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> <span class="keyword">function</span> <span class="title function_">replace_response_text</span>(<span class="params">response, upstream_domain, host_name</span>) {</span><br><span class="line">    <span class="keyword">let</span> text = <span class="keyword">await</span> response.<span class="title function_">text</span>()</span><br><span class="line"></span><br><span class="line">    <span class="keyword">var</span> i, j;</span><br><span class="line">    <span class="keyword">for</span> (i <span class="keyword">in</span> replace_dict) {</span><br><span class="line">        j = replace_dict[i]</span><br><span class="line">        <span class="keyword">if</span> (i == <span class="string">'$upstream'</span>) {</span><br><span class="line">            i = upstream_domain</span><br><span class="line">        } <span class="keyword">else</span> <span class="keyword">if</span> (i == <span class="string">'$custom_domain'</span>) {</span><br><span class="line">            i = host_name</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> (j == <span class="string">'$upstream'</span>) {</span><br><span class="line">            j = upstream_domain</span><br><span class="line">        } <span class="keyword">else</span> <span class="keyword">if</span> (j == <span class="string">'$custom_domain'</span>) {</span><br><span class="line">            j = host_name</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">let</span> re = <span class="keyword">new</span> <span class="title class_">RegExp</span>(i, <span class="string">'g'</span>)</span><br><span class="line">        text = text.<span class="title function_">replace</span>(re, j);</span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">return</span> text;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> <span class="keyword">function</span> <span class="title function_">device_status</span>(<span class="params">user_agent_info</span>) {</span><br><span class="line">    <span class="keyword">var</span> agents = [<span class="string">"Android"</span>, <span class="string">"iPhone"</span>, <span class="string">"SymbianOS"</span>, <span class="string">"Windows Phone"</span>, <span class="string">"iPad"</span>, <span class="string">"iPod"</span>];</span><br><span class="line">    <span class="keyword">var</span> flag = <span class="literal">true</span>;</span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> v = <span class="number">0</span>; v &lt; agents.<span class="property">length</span>; v++) {</span><br><span class="line">        <span class="keyword">if</span> (user_agent_info.<span class="title function_">indexOf</span>(agents[v]) &gt; <span class="number">0</span>) {</span><br><span class="line">            flag = <span class="literal">false</span>;</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">        }</span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">return</span> flag;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p>同样绑定域名后，访问域名，你就可以类似与<code>github</code>一样访问啦！</p><h3 id="限制"><a href="#限制" class="headerlink" title="限制"></a>限制</h3><p>在使用转发服务时，请留意以下几点限制：</p><ol><li><p><strong>请求数量限制</strong>：免费账户每天最多可以处理100,000个请求。请确保使用量在这个范围内，避免超出限制。</p></li><li><p><strong>性能考量</strong>：虽然<code>Cloudflare</code>提供了全球的网络覆盖，但在国内使用时，加速效果可能会受到一些限制。因此，我们可能会遇到访问速度不如预期，甚至偶尔出现卡顿的情况。</p></li><li><p><strong>性能波动</strong>：网络状况的不确定性可能导致服务体验出现波动，有时甚至可能出现性能不如直接访问原始资源的负优化现象。</p></li><li><p><strong>自主选择</strong>：建议根据自己的实际需求和体验，自主决定是否采用转发服务。</p></li></ol><h2 id="免责声明"><a href="#免责声明" class="headerlink" title="免责声明"></a>免责声明</h2><p>本代码示例仅供学习和教育目的使用。通过使用此代码，您需要同意以下条款：</p><ol><li><p><strong>学习用途</strong>：此代码应仅作为学习和了解相关技术概念的工具。</p></li><li><p><strong>不承担责任</strong>：提供此代码的作者或组织不承担因使用此代码而可能产生的任何直接、间接、特殊或后果性损害的责任。</p></li><li><p><strong>遵守法律</strong>：使用此代码时，您应确保遵守所有适用的地方、州、国家和国际法律及规定。</p></li><li><p><strong>不侵犯版权</strong>：您不得使用此代码侵犯任何第三方的版权、商标或其他知识产权。</p></li><li><p><strong>不用于非法目的</strong>：您不得将此代码用于任何非法、欺诈性或恶意活动。</p></li><li><p><strong>免责声明</strong>：本代码“按原样”提供，不提供任何形式的保证，包括适销性、适用于特定目的的保证或不侵权的保证。</p></li><li><p><strong>风险自负</strong>：使用此代码的风险由您自行承担。在使用过程中，您应采取适当的预防措施，以保护您的设备和数据。</p></li><li><p><strong>免责声明的更改</strong>：我们保留随时修改此免责声明的权利，且修改后的免责声明自发布之日起生效。</p></li></ol><h2 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h2><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly93d3cuem91aHQuY29tLzM3NDAuaHRtbA" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a4632bbf06e.webp)"></div><div class="tag-link-right"><div class="tag-link-title">颢天博客，无限进步</div><div class="tag-link-sitename">使用 Cloudflare Workers 搭建反向代理加速器</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly9jbG91ZC50ZW5jZW50LmNvbS9kZXZlbG9wZXIvYXJ0aWNsZS8yMjExNTU3" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2025/04/08/67f4cf44d4d5e.webp)"></div><div class="tag-link-right"><div class="tag-link-title">利用CloudFlare的Workers和Pages反代Github并缓存实现Github文件加速访问</div><div class="tag-link-sitename">腾讯云开发者社区</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><p><em>— 柳影曳曳，清酒孤灯，扬笔撒墨，心境如霜</em></p><p><strong>PS:</strong> 我的博客即将同步至腾讯云开发者社区，邀请大家一同入驻：<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly9jbG91ZC50ZW5jZW50LmNvbS9kZXZlbG9wZXIvc3VwcG9ydC1wbGFuP2ludml0ZV9jb2RlPTJtbnNsNWZ2ZW02OG8">https://cloud.tencent.com/developer/support-plan?invite_code=2mnsl5fvem68o</a></p></article><div class="post-copyright"><div class="post-copyright__title"><span class="post-copyright-info"><h>使用Cf Workers搭建反代加速器</h></span></div><div class="post-copyright__type"><span class="post-copyright-info"><a href="https://blog.liushen.fun/posts/dd89adc9/">https://blog.liushen.fun/posts/dd89adc9/</a></span></div><div class="post-copyright-m"><div class="post-copyright-m-info" style="position:relative;z-index:3"><div class="post-copyright-a" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>作者</h><div class="post-copyright-cc-info"><h>LiuShen</h></div></div><div class="post-copyright-c" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>发布于</h><div class="post-copyright-cc-info"><h>2024-05-24</h></div></div><div class="post-copyright-u" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>更新于</h><div class="post-copyright-cc-info"><h>2024-05-24</h></div></div><div class="post-copyright-c" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>许可协议</h><div class="post-copyright-cc-info"><a rel="noopener" target="_blank" title=" CC BY 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1">CC BY-NC-SA 4.0</a></div></div></div></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E5%8A%A0%E9%80%9F/">加速</a><a class="post-meta__tags" href="/tags/%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/">反向代理</a><a class="post-meta__tags" href="/tags/%E6%97%A5%E5%B8%B8%E5%88%86%E4%BA%AB/">日常分享</a><a class="post-meta__tags" href="/tags/Cloudflare/">Cloudflare</a></div><div class="post-share"><div class="social-share" data-image="https://p.liiiu.cn/i/2024/05/24/6650245a705d1.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/butterfly-extsrc@1.1.4/sharejs/dist/css/share.min.css" media="print" onload='this.media="all"'><script src="https://jsd.liiiu.cn/npm/butterfly-extsrc@1.1.4/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i>来😍鼠标过来一点~</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/config/img/wechat.png" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="/config/img/wechat.png" alt="微信"></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="/config/img/wechat.png" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="/config/img/wechat.png" alt="支付宝"></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><a class="prev-post pull-left" href="/posts/f2c15334/" title="计算机网络复习：概述"><img class="cover" src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/22/664dfc89133c2.png" onerror='onerror=null,src="/img/404.jpg"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">计算机网络复习：概述</div></div></a><a class="next-post pull-right" href="/posts/6d87a301/" title="计算机网络复习：物理层"><img class="cover" src="" data-lazy-src="https://p.liiiu.cn/i/2024/05/25/6650c3202f779.png" onerror='onerror=null,src="/img/404.jpg"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">计算机网络复习：物理层</div></div></a></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><a href="/posts/a841c/" title="通义灵码，你的编程小助手"><img class="cover" src="" data-lazy-src="https://p.liiiu.cn/i/2024/04/07/6611fce3248d7.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-04-07</div><div class="title">通义灵码，你的编程小助手</div></div></a><a href="/posts/24538266/" title="华为通用软件开发工程师面经"><img class="cover" src="" data-lazy-src="https://p.liiiu.cn/i/2024/12/25/676bc5f28c270.webp" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-12-25</div><div class="title">华为通用软件开发工程师面经</div></div></a><a href="/posts/7915ee6b/" title="数据库可视化WEB工具对比"><img class="cover" src="" data-lazy-src="https://p.liiiu.cn/i/2025/05/25/6832cc105bc41.webp" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2025-05-25</div><div class="title">数据库可视化WEB工具对比</div></div></a></div></div><hr class="custom-hr"><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div></div><div class="comment-wrap"><div><div id="artalk-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info is-center"><div class="author-info-detail"><p class="author-info-hello">👋 欢迎光临！</p><p class="author-info-desc">你们好呀！我是站长LiuShen！一个快乐，积极，热爱生活的孩纸！😜😜😜</p></div><div class="avatar-img"><img class="mood-icon" src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/14/67d301461a24a.webp" alt="🤤" onerror='this.onerror=null,this.src="/img/friend_404.gif"'><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/13/67d2fc82d329c.webp" onerror='this.onerror=null,this.src="/img/friend_404.gif"' alt="avatar"></div><div class="author-info-name">LiuShen</div><div class="site-data"><a href="/archives/"><div class="headline">文章</div><div class="length-num">72</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">98</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/willow-god"><i class="fab fa-github"></i><span>Follow Me 🛫</span></a><div class="card-info-social-icons"><a class="social-icon" href="mailto:01@liushen.fun" target="_blank" title="Email"><i class="fa-solid fa-envelope"></i></a><a class="social-icon" href="http://wpa.qq.com/msgrd?v=3&amp;uin=3162475700&amp;site=qq&amp;menu=yes" target="_blank" title="QQ：3162475700"><i class="fa-brands fa-qq"></i></a><a class="social-icon" href="https://wakatime.com/@LiuShen" target="_blank" title="Wakatime"><i class="fa-solid fa-chart-column"></i></a><a class="social-icon" href="https://blog.liushen.fun/atom.xml" target="_blank" title="rss地址"><i class="fa-solid fa-rss"></i></a></div></div><div class="card-widget" id="card-poem"><div id="poem_sentence"></div><div id="poem_info"><div id="poem_dynasty"></div><div id="poem_author"></div></div></div><script src="/js/jinrishici.js" charset="utf-8"></script><script>jinrishici.load((function(e){var n=document.querySelector("#poem_sentence"),t=document.querySelector("#poem_author"),o=document.querySelector("#poem_dynasty"),r=e.data.content;r=r.substr(0,r.length-1),n.innerHTML=r,o.innerHTML=e.data.origin.dynasty,t.innerHTML=e.data.origin.author+"《"+e.data.origin.title+"》"}))</script><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content"><p><strong>博客架构概览：</strong><br>⚙️框架核心：Hexo<br>🕹️界面设计：Butterfly<br>🔮安全保障：长亭雷池<br>🔩管理工具：宝塔面板，1Panel<br>🎰服务器支持：阿里云，腾讯云<br>🎲CDN加速：多吉云，CloudFlare<br><strong>快捷跳转地址：</strong><br>🧩个人相册：<a target="_blank" rel="noopener" href="https://xc.liushen.fun">xc.liushen.fun</a><br>🤖个人导航：<a target="_blank" rel="noopener" href="https://www.liushen.fun">www.liushen.fun</a><br></p><img src="" data-lazy-src="/config/img/notice.gif" alt="可爱捏" title="可爱捏" style="width:100%;border-radius:10px"></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%A2%8E%E7%A2%8E%E5%BF%B5"><span class="toc-text">碎碎念</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8E%9F%E7%90%86"><span class="toc-text">原理</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%95%99%E7%A8%8B"><span class="toc-text">教程</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%80%E9%9C%80%E5%B7%A5%E5%85%B7"><span class="toc-text">所需工具</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9B%E5%BB%BACF-Worker"><span class="toc-text">创建CF-Worker</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%80%9A%E7%94%A8%E8%BD%AC%E5%8F%91"><span class="toc-text">通用转发</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B"><span class="toc-text">使用教程</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%93%E7%94%A8%E8%BD%AC%E5%8F%91"><span class="toc-text">专用转发</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%99%90%E5%88%B6"><span class="toc-text">限制</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%85%8D%E8%B4%A3%E5%A3%B0%E6%98%8E"><span class="toc-text">免责声明</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E9%93%BE%E6%8E%A5"><span class="toc-text">参考链接</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/7915ee6b/" title="数据库可视化WEB工具对比"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/05/25/6832cc105bc41.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="数据库可视化WEB工具对比"></a><div class="content"><a class="title" href="/posts/7915ee6b/" title="数据库可视化WEB工具对比">数据库可视化WEB工具对比</a><time datetime="2025-05-25T10:01:21.000Z" title="更新于 2025-05-25 18:01:21">2025-05-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/40702a0d/" title="本地实现HEXO文章AI摘要"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/05/06/6819cd4532457.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="本地实现HEXO文章AI摘要"></a><div class="content"><a class="title" href="/posts/40702a0d/" title="本地实现HEXO文章AI摘要">本地实现HEXO文章AI摘要</a><time datetime="2025-05-06T16:01:21.000Z" title="更新于 2025-05-07 00:01:21">2025-05-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/5f71a4b1/" title="耗子面板和DPanel简单体验"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/04/27/680dc7916ef34.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="耗子面板和DPanel简单体验"></a><div class="content"><a class="title" href="/posts/5f71a4b1/" title="耗子面板和DPanel简单体验">耗子面板和DPanel简单体验</a><time datetime="2025-04-28T14:48:21.000Z" title="更新于 2025-04-28 22:48:21">2025-04-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/caee2d9f/" title="美化你的RSS订阅地址"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/04/18/68024a618942b.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="美化你的RSS订阅地址"></a><div class="content"><a class="title" href="/posts/caee2d9f/" title="美化你的RSS订阅地址">美化你的RSS订阅地址</a><time datetime="2025-04-18T12:48:21.000Z" title="更新于 2025-04-18 20:48:21">2025-04-18</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap" style="background:0 0"><div id="footer_icons"><div><a class="icon_link" rel="noopener external nofollow" href="https://www.liushen.fun/" title="导航站点" target="_blank"><i class="fa-solid fa-compass"></i></a><a class="icon_link" rel="noopener external nofollow" href="https://admin.qidian.qq.com/static_proxy/b2b-qq/wpa-link/index.html#/person?uin=3162475700" title="联系QQ" target="_blank"><i class="fa-brands fa-qq"></i></a><a class="icon_link" rel="noopener external nofollow" href="https://github.com/willow-god" title="我的github主页" target="_blank"><i class="fa-brands fa-github"></i></a><a class="icon_link" rel="noopener external nofollow" href="mailto:01@liushen.fun" title="发送邮件至博主邮箱" target="_blank"><i class="fa-solid fa-envelope"></i></a></div><div class="footer_logo_container" onclick="btf.scrollToDest(0,500)" title="返回顶部"><img class="footer_logo" src="" data-lazy-src="/img/footer.gif"></div><div><a class="icon_link" rel="noopener external nofollow" href="https://wakatime.com/@LiuShen" title="Wikitime" target="_blank"><i class="fa-solid fa-clock"></i></a><a class="icon_link" rel="noopener external nofollow" href="https://gitlab.com/" title="gitlab" target="_blank"><i class="fa-brands fa-gitlab"></i></a><a class="icon_link" href="/shuoshuo/" title="日常说说" data-pjax-state="data-pjax-state"><i class="fa-solid fa-file-pen"></i></a><a class="icon_link" href="/comment/" title="留言板" data-pjax-state="data-pjax-state"><i class="fa-solid fa-comment"></i></a></div></div><div id="footer_content"><div class="footer-group"><h3 class="footer-title">关于本站</h3><div class="footer-links"><a class="footer-item" target="_blank" href="https://www.liushen.fun/">导航站点</a><a class="footer-item" href="/shuoshuo/">日常说说</a><a class="footer-item" target="_blank" href="https://um.liushen.fun/share/bIEnQp0xnMxD8c9V/blog.liushen.fun">访客信息</a><a class="footer-item" target="_blank" href="https://mm.liushen.fun/">提笔摘星</a><a class="footer-item" target="_blank" href="https://status.liushen.fun/">在线状态</a><a class="footer-item" href="/subscribe/">订阅本站</a></div></div><div class="footer-group"><h3 class="footer-title">加入组织</h3><div class="footer-links"><a class="footer-item" target="_blank" href="https://www.boyouquan.com/home">博友圈</a><a class="footer-item" target="_blank" href="https://github.com/timqian/chinese-independent-blogs">中博列表</a><a class="footer-item" target="_blank" href="https://blogwe.com/">博客我们</a><a class="footer-item" target="_blank" href="https://storeweb.cn/">个性商店</a><a class="footer-item" target="_blank" href="https://bf.zzxworld.com/">发现博客</a><a class="footer-item" target="_blank" href="https://ourblo.gs/">OurBlogs</a></div></div><div class="footer-group"><h3 class="footer-title">文章整理</h3><div class="footer-links"><a class="footer-item" href="/categories/website/">博客管理</a><a class="footer-item" href="/categories/learning/">学习资料</a><a class="footer-item" href="/categories/daily-share/">日常分享</a><a class="footer-item" href="/archives/">时光卷轴</a><a class="footer-item" href="/charts/">文章通览</a><a class="footer-item" href="/categories/">查看全部</a></div></div><div class="footer-group"><h3 class="footer-title">文章标签</h3><div class="footer-links"><a class="footer-item" href="/tags/JavaScript/">JS知识</a><a class="footer-item" href="/tags/Hexo/">本站框架</a><a class="footer-item" href="/tags/机器学习/">机器学习</a><a class="footer-item" href="/tags/日记/">个人日记</a><a class="footer-item" href="/tags/CSS/">CSS知识</a><a class="footer-item" href="/tags/">查看全部</a></div></div><div class="footer-group"><h3 class="footer-title">自建工具</h3><div class="footer-links"><a class="footer-item" target="_blank" rel="noopener" href="https://chat.liushen.fun/">清羽AI</a><a class="footer-item" target="_blank" rel="noopener" href="https://hot.liushen.fun/">今日热榜</a><a class="footer-item" target="_blank" rel="noopener" href="https://cover.qyliu.top/">封面设计</a><a class="footer-item" target="_blank" rel="noopener" href="https://icon.qyliu.top/">万变图标</a><a class="footer-item" target="_blank" rel="noopener" href="https://tmail.qyliu.top/">临时邮箱</a><a class="footer-item" target="_blank" rel="noopener" href="https://share.liushen.fun/">内容中转</a></div></div><div class="footer-group" id="friend-links-in-footer"><h3 class="footer-title">友链<button title="换一批" href="javascript:;" onclick="liushen.randomLink()"><i class="fa-solid fa-rotate-right"></i></button></h3><div class="footer-links"><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试1</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试2</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试3</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试4</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试5</a><a class="footer-item" href="/link/" data-pjax-state="data-pjax-state">查看更多</a></div></div></div><div id="footer-bottom"><div class="footer-bottom-content"><div class="footer-bottom-left"><span class="copyright">©2021 - 2025 By <a target="_blank" rel="noopener" href="https://blog.liushen.fun/about/" title="点击访问&quot;LiuShen&quot;的主页" style="margin-left:5px">LiuShen</a></span><div><a class="footer-bottom-link" target="_blank" href="https://beian.miit.gov.cn/" rel="noopener external nofollow" title="工信部备案号">陕ICP备2024028531号-2</a><a class="footer-bottom-link" target="_blank" href="https://beian.mps.gov.cn/#/query/webSearch?code=61011602000637" rel="noopener external nofollow" title="公安备案号">陕公网安备61011602000637号</a></div></div><div class="footer-bottom-right"><div id="runtime" title="本站运行时间">本站已苟活：0 天 0 时 0 分 0 秒</div><div><a class="footer-bottom-link" target="_blank" href="https://www.dogecloud.com/?iuid=9173" rel="noopener external nofollow" title="本站通过多吉云CDN提供站点加速">多吉云CDN</a><a class="footer-bottom-link" target="_blank" href="https://hexo.io/zh-cn/" rel="noopener external nofollow" title="本站使用Hexo架构搭建而成">Hexo静态框架</a><a class="footer-bottom-link" target="_blank" href="https://butterfly.js.org/" rel="noopener external nofollow" title="本站主题由Butterfly主题魔改而成">LiuShen主题</a></div></div></div></div></div><script>window.liushen||(window.liushen={saveData:(e,n)=>{localStorage.setItem(e,JSON.stringify({time:Date.now(),data:n}))},loadData:(e,n)=>{let t=JSON.parse(localStorage.getItem(e));if(t){let e=Date.now()-t.time;if(e>=0&&e<6e4*n)return t.data}return null},runtime:()=>{const e=e=>e>9?e:"0"+e,n=new Date("2021/12/12 01:27:36").getTime(),t=Date.now();let i=Math.round((t-n)/1e3),o="本站已苟活：";i>=86400&&(o+=`${e(Math.floor(i/86400))} 天 `,i%=86400),i>=3600&&(o+=`${e(Math.floor(i/3600))} 时 `,i%=3600),i>=60&&(o+=`${e(Math.floor(i/60))} 分 `,i%=60),o+=`${e(i)} 秒`;const l=document.getElementById("runtime");l&&(l.innerHTML=o),setTimeout(window.liushen.runtime,1e3)},randomLink:()=>{let e=window.liushen.loadData("links",30);if(e){let n=document.querySelectorAll("#friend-links-in-footer .footer-item");if(!n.length)return;for(let t=0;t<n.length;t++){let i=Math.floor(Math.random()*e.length);n[t].innerText=e[i].name,n[t].href=e[i].link,e.splice(i,1)}}else fetch("/flink_count.json").then((e=>e.json())).then((e=>{window.liushen.saveData("links",e.link_list),window.liushen.randomLink()}))}}),window.liushen.randomLink(),document.addEventListener("DOMContentLoaded",window.liushen.randomLink),window.liushen.runtime()</script></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换" style="width:35px">繁</button><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i><span class="rightside-text">阅读模式</span></button><button id="darkmode" type="button" title="日间和夜间模式切换"><i class="fa-regular fa-star-half-stroke"></i><span class="rightside-text">亮暗切换</span></button><button id="cat" onclick="toggleLive2dVisibility()" title="小猫显隐"><i class="fa-solid fa-cat"></i><span class="rightside-text">小猫显隐</span></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fa-solid fa-arrows-left-right-to-line"></i><span class="rightside-text">侧栏显隐</span></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i><span class="rightside-text">更多设置</span></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i><span class="rightside-text">显示目录</span></button><button id="fullscreen" onclick="toggleFullScreen()" title="全屏切换"><i class="fa-solid fa-expand"></i><span class="rightside-text">全屏切换</span></button><a id="to_comment" href="#post-comment" title="前往评论"><i class="fas fa-comments"></i><span class="rightside-text">快速评论</span></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i><span class="rightside-text">回到顶部</span></button></div></div><div id="rightMenu"><div class="rightMenu-group rightMenu-small"><div class="rightMenu-item" id="menu-backward"><i class="fa-solid fa-arrow-left"></i></div><div class="rightMenu-item" id="menu-forward"><i class="fa-solid fa-arrow-right"></i></div><div class="rightMenu-item" id="menu-refresh"><i class="fa-solid fa-arrow-rotate-right"></i></div><div class="rightMenu-item" id="menu-home"><i class="fa-solid fa-house"></i></div></div><div class="rightMenu-group rightMenu-line hide" id="menu-text"><a class="rightMenu-item" id="copy" href="javascript:rm.copySelect();"><i class="fa-solid fa-copy"></i><span>复制选中文字</span></a><a class="rightMenu-item" id="reply" href="javascript:rm.replySelect();"><i class="fa-regular fa-comment"></i><span>评论选中段落</span></a></div><div class="rightMenu-group rightMenu-line rightMenuOther"><a class="rightMenu-item menu-link" href="/archives/"><i class="fa-solid fa-archive"></i><span>文章时间线</span></a><a class="rightMenu-item menu-link" href="/categories/"><i class="fa-solid fa-folder-open"></i><span>文章分大类</span></a><a class="rightMenu-item menu-link" href="/tags/"><i class="fa-solid fa-tags"></i><span>文章小标签</span></a></div><div class="rightMenu-group rightMenu-line rightMenuNormal"><a class="rightMenu-item menu-link" id="menu-radompage" href="/comment/"><i class="fa-solid fa-shoe-prints"></i><span>随心留言板</span></a><div class="rightMenu-item" id="menu-translate"><i class="fa-solid fa-earth-asia"></i><span>繁简模式切换</span></div><div class="rightMenu-item" id="menu-live2dvisibility"><i class="fa-solid fa-cat"></i><span>小猫显示隐藏</span></div><div class="rightMenu-item" id="menu-print"><i class="fa-solid fa-print fa-fw"></i><span>打印整个页面</span></div><a class="rightMenu-item menu-link" id="statement" href="/statement/"><i class="fa-regular fa-copyright fa-fw"></i><span>网站声明</span></a></div></div><div id="rightmenu-mask"></div><div><script src="/js/others.js?v=5.0.0"></script><script src="/js/utils.js?v=5.0.0"></script><script src="/js/main.js?v=5.0.0"></script><script src="https://jsd.liiiu.cn/npm/echarts@5.5.1/dist/echarts.simple.min.js"></script><script src="/js/rightmenu.js?v=5.0.0"></script><script src="/js/jinrishici.js"></script><script src="/js/tw_cn.js?v=5.0.0"></script><script src="https://jsd.liiiu.cn/npm/@fancyapps/ui@5.0.36/dist/fancybox/fancybox.umd.min.js"></script><script src="https://jsd.liiiu.cn/npm/instant.page@5.2.0/instantpage.min.js" type="module"></script><script src="https://jsd.liiiu.cn/npm/vanilla-lazyload@19.1.3/dist/lazyload.iife.min.js"></script><div class="js-pjax"><script>(()=>{let t=null;const e=null,o="shuoshuo"===GLOBAL_CONFIG_SITE.pageType,a=()=>{t&&(t.destroy(),t=null)},n=e=>t&&t.setDarkMode("dark"===e),l=(l=document,i=location.pathname)=>{t=Artalk.init({el:l.querySelector("#artalk-wrap"),server:"https://atk.liushen.fun",site:"清羽飞扬",darkMode:"dark"===document.documentElement.getAttribute("data-theme"),...e,pageKey:i,imgUploader:function(t){let e="Bearer 28|q18njD3pLtHiFy9WidqQrREwqZzb8Zionr8WzilI",o="https://www.baiwulin.work/api/v1/upload",a=new Headers;a.set("Accept","application/json"),a.set("Authorization",e);let n=new FormData;n.append("file",t);const l=(t,e,o)=>fetch(t,{method:"POST",body:e,headers:o}).then((t=>t.json())).then((t=>t.data.links.url)).catch((t=>(console.error("Image upload failed:",t),null)));return l(o,n,a).then((t=>t||(console.warn("雾林图床接口失败，尝试替换为秋叶图床"),e="Bearer 11|lsReISlSS0dyhDzt35ovtfYefGbWSRW2vvntPXs7",o="https://imgse.koxiuqiu.cc/api/v1/upload",a.set("Authorization",e),l(o,n,a))))}}),"null"!==GLOBAL_CONFIG.lightbox&&(t.on("list-loaded",(()=>{t.ctx.get("list").getCommentNodes().forEach((t=>{const e=t.getRender().$content;btf.loadLightbox(e.querySelectorAll("img:not([atk-emoticon])"))}))})),o&&(window.shuoshuoComment.destroyArtalk=()=>{a(),l.children.length&&(l.innerHTML="",l.classList.add("no-comment"))}),btf.addGlobalFn("pjaxSendOnce",a,"destroyArtalk"),btf.addGlobalFn("themeChange",n,"artalk"))},i=async(t,e)=>{"object"==typeof Artalk||(await btf.getCSS("https://jsd.liiiu.cn/npm/artalk@2.9.1/dist/Artalk.min.css"),await btf.getScript("https://jsd.liiiu.cn/npm/artalk@2.9.1/dist/Artalk.min.js")),l(t,e)};o?window.shuoshuoComment={loadComment:i}:setTimeout(i,0)})()</script></div><script>window.newestComments={changeContent:e=>(""===e||(e=(e=(e=(e=(e=e.replace(/<img.*?src="(.*?)"?[^\>]+>/gi,"[图片]")).replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,"[链接]")).replace(/<pre><code>.*?<\/pre>/gi,"[代码]")).replace(/<code>.*?<\/code>/gi,"[代码]")).replace(/<[^>]+>/g,"")).length>150&&(e=e.substring(0,150)+"..."),e),generateHtml:(e,t)=>{let n="";if(e.length)for(let t=0;t<e.length;t++){if(n+='<div class="aside-list-item">',e[t].avatar){const a="data-lazy-src";n+=`<a href="${e[t].url}" class="thumbnail"><img ${a}="${e[t].avatar}" alt="${e[t].nick}"></a>`}n+=`<div class="content">\n        <a class="comment" href="${e[t].url}" title="${e[t].content}">${e[t].content}</a>\n        <div class="name"><span>${e[t].nick} / </span><time datetime="${e[t].date}">${btf.diffDate(e[t].date,!0)}</time></div>\n        </div></div>`}else n+="暂无评论";t.innerHTML=n,window.lazyLoadInstance&&window.lazyLoadInstance.update(),window.pjax&&window.pjax.refresh(t)},newestCommentInit:(e,t)=>{const n=document.querySelector("#card-newest-comments .aside-list");if(n){const a=btf.saveToLocal.get(e);a?newestComments.generateHtml(JSON.parse(a),n):t(n)}},run:(e,t)=>{newestComments.newestCommentInit(e,t),btf.addGlobalFn("pjaxComplete",(()=>newestComments.newestCommentInit(e,t)),e)}}</script><script>window.addEventListener("load",(()=>{const t="artalk-newest-comments",{changeContent:a,generateHtml:e,run:n}=window.newestComments,r=new URLSearchParams({site_name:"清羽飞扬",limit:"5"});n(t,(async n=>{try{const s=await fetch(`https://atk.liushen.fun/api/v2/stats/latest_comments?${r}`),o=await s.json(),{avatarCdn:c,avatarDefault:i}=await(async()=>{const t=t=>t.startsWith("d=")?t:`d=${t}`;try{const a=await fetch("https://atk.liushen.fun/api/v2/conf"),e=await a.json(),{mirror:n,params:r,default:s}=e.frontend_conf.gravatar;return{avatarCdn:n,avatarDefault:t(r||s)}}catch(a){return console.error(a),{avatarCdn:"",avatarDefault:t("")}}})(),l=o.data.map((t=>({avatar:c&&t.email_encrypted?`${c}${t.email_encrypted}?${i}`:"",content:a(t.content_marked),nick:t.nick,url:t.page_url,date:t.date})));btf.saveToLocal.set(t,JSON.stringify(l),10/1440),e(l,n)}catch(t){console.log(t),n.textContent="无法获取评论，请确认相关配置是否正确"}}))}))</script><script src="/config/memos/memos.js"></script><script id="canvas_nest" defer color="128,128,128" opacity="0.7" zindex="-1" count="99" mobile="false" src="https://jsd.liiiu.cn/npm/butterfly-extsrc@1.1.4/dist/canvas-nest.min.js"></script><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/aplayer@1.10.1/dist/APlayer.min.css" media="print" onload='this.media="all"'><script src="https://jsd.liiiu.cn/npm/aplayer@1.10.1/dist/APlayer.min.js"></script><script src="https://jsd.liiiu.cn/npm/meting@2.0.1/dist/Meting.min.js"></script><script src="https://jsd.liiiu.cn/npm/pjax@0.2.8/pjax.min.js"></script><script>(()=>{window.pjax=new Pjax({elements:'a:not([target="_blank"])',selectors:["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"],cacheBust:!1,analytics:!1,scrollRestoration:!1});const e=e=>{e&&Object.values(e).forEach((e=>e()))};document.addEventListener("pjax:send",(()=>{btf.removeGlobalFnEvent("pjaxSendOnce"),btf.removeGlobalFnEvent("themeChange");const t=document.body.classList;t.contains("read-mode")&&t.remove("read-mode"),e(window.globalFn.pjaxSend)})),document.addEventListener("pjax:complete",(()=>{btf.removeGlobalFnEvent("pjaxCompleteOnce"),document.querySelectorAll("script[data-pjax]").forEach((e=>{const t=document.createElement("script"),n=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach((e=>t.setAttribute(e.name,e.value))),t.appendChild(document.createTextNode(n)),e.parentNode.replaceChild(t,e)})),e(window.globalFn.pjaxComplete)})),document.addEventListener("pjax:error",(e=>{404===e.request.status&&pjax.loadUrl("/404")}))})()</script><script async data-pjax="" src="/config/busuanzi/busuanzi.js"></script><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-info"><div class="algolia-stats"></div><div class="algolia-poweredBy"></div></div></div></div></div><div id="search-mask"></div><script src="https://jsd.liiiu.cn/npm/algoliasearch@5.8.1/dist/lite/builds/browser.umd.min.js"></script><script src="https://jsd.liiiu.cn/npm/instantsearch.js@4.75.0/dist/instantsearch.production.min.js"></script><script src="/js/search/algolia.js?v=5.0.0"></script></div></div><div class="needEndHide" id="nav-music"><div id="nav-music-hoverTips" onclick="liuMusic.musicToggle()">音乐已暂停</div><meting-js id="13597135963" server="netease" type="playlist" mutex="true" preload="none" data-lrctype="0" order="random" volume="0.8" api="https://met.liiiu.cn/meting/api?server=:server&amp;type=:type&amp;id=:id&amp;r=:r"></meting-js></div><script data-pjax="">function butterfly_swiper_injector_config(){var a=document.getElementById("recent-posts");console.log("已挂载butterfly_swiper"),a.insertAdjacentHTML("afterbegin",'<div class="recent-post-item" style="height: auto;width: 100%"><div class="blog-slider swiper-container-fade swiper-container-horizontal" id="swiper_container"><div class="blog-slider__wrp swiper-wrapper" style="transition-duration: 0ms;"><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/4bb33804/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/04/08/67f49876a62e5.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-04-08</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/4bb33804/&quot;);" href="javascript:void(0);" alt="">PaddleYOLO训练自己的数据集</a><div class="blog-slider__text">近期一直在研究毕业设计，在其中，我涉及到了PaddleYOLO的训练和部署，在网上的教程较少，经过不断努力，我也算是跑出来了，所以在这里分享出来做个记录，防止下次使用又忘记了怎么搞。</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/4bb33804/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/5f71a4b1/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/04/27/680dc7916ef34.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-04-28</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/5f71a4b1/&quot;);" href="javascript:void(0);" alt="">耗子面板和DPanel简单体验</a><div class="blog-slider__text">最近毕业设计临近尾声，代码也敲完了，目前就剩稍微的调优，就可以开始写论文啦！在闲暇时间，我也尝试部署了一些不一样的面板程序，总感觉1panel稍微有些复杂，很多功能并用不上，比如GPU，下面简单分享一下我的体验。</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/5f71a4b1/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/40702a0d/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/05/06/6819cd4532457.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-05-07</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/40702a0d/&quot;);" href="javascript:void(0);" alt="">本地实现HEXO文章AI摘要</a><div class="blog-slider__text">五一假期结束啦！这五天啥也没干，就在宿舍敲代码，都快无聊死了，恰逢找到了一些免费API，就自己实现一个AI摘要吧！利用API生成摘要文本放在文章头部，再通过hexo进行渲染就好啦！</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/40702a0d/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/7915ee6b/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/05/25/6832cc105bc41.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-05-25</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/7915ee6b/&quot;);" href="javascript:void(0);" alt="">数据库可视化WEB工具对比</a><div class="blog-slider__text">最近迁移服务器，并且搞了一个1P专业版玩玩，感觉效果很不错，想找一个管理数据库的服务，其中看了phpmyadmin等一些知名项目，但是都不太符合我的要求，最后经过筛选，找到了比较合适的，分享给大家！</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/7915ee6b/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/caee2d9f/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/04/18/68024a618942b.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-04-18</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/caee2d9f/&quot;);" href="javascript:void(0);" alt="">美化你的RSS订阅地址</a><div class="blog-slider__text">近期天天忙着毕业设计，冷落了站点文章的更新，最近也终于算是快要搞完了，于是开始捣鼓一些好玩的东西，在浏览阮一峰大佬的周刊时，了解到了RSS也能美化，折腾了一下，没想到还真实现了，在此分享一下。</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/caee2d9f/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div></div><div class="blog-slider__pagination swiper-pagination-clickable swiper-pagination-bullets"></div></div></div>')}for(var elist="null".split(","),cpage=location.pathname,epage="/",flag=0,i=0;i<elist.length;i++)cpage.includes(elist[i])&&flag++;("all"===epage&&0==flag||epage===cpage)&&butterfly_swiper_injector_config()</script><script defer src="https://jsd.liiiu.cn/npm/swiper@11.1.14/swiper-bundle.min.js"></script><script defer data-pjax="" src="/config/swiper/swiper_init.js"></script><script src="https://jsd.liiiu.cn/npm/live2d-widget@^3.1.3/lib/L2Dwidget.min.js"></script><script>L2Dwidget.init({pluginModelPath:"assets/",model:{scale:1,hHeadPos:.5,vHeadPos:.618,jsonPath:"/live2dw/assets/tororo.model.json"},display:{superSample:2,width:250,height:500,position:"left",hOffset:-20,vOffset:-90},mobile:{show:!1,scale:.5},react:{opacityDefault:.7,opacityOnHover:.2},log:!1,pluginJsPath:"lib/",pluginRootPath:"live2dw/",tagMode:!1})</script></body></html>